# import win32gui
# import win32ui
# import win32con

# def getBitMap():
#     name = "夜神模拟器"
#     hwnd = win32gui.FindWindow(None, name)
#     left, top, right, bot = win32gui.GetWindowRect(hwnd)
#     w = right - left
#     h = bot - top
#     print(w,h)
#     wDC = win32gui.GetWindowDC(hwnd)
#     dcObj=win32ui.CreateDCFromHandle(wDC)
#     cDC=dcObj.CreateCompatibleDC()
#     dataBitMap = win32ui.CreateBitmap()
#     dataBitMap.CreateCompatibleBitmap(dcObj, w, h)
#     cDC.SelectObject(dataBitMap)
#     cDC.BitBlt((0,0),(w, h) , dcObj, (0,0), win32con.SRCCOPY)
#     dataBitMap.SaveBitmapFile(cDC, "shot.bmp")
#     # Free Resources
#     dcObj.DeleteDC()
#     cDC.DeleteDC()
#     win32gui.ReleaseDC(hwnd, wDC)
#     win32gui.DeleteObject(dataBitMap.GetHandle())
import asyncio
import time
 
async def say_after(delay, what):
    await asyncio.sleep(delay)
    print(f"{what} at {time.strftime('%X')}")
 
async def main():
    task1 = say_after(1, 'hello')
    task2 = asyncio.create_task(
        say_after(2, 'world'))
    print(f"started at {time.strftime('%X')}")
    # Wait until both tasks are completed (should take
    # around 2 seconds.)
    # await asyncio.sleep(3)
 
    # await task1
    # await task2
    print(f"finished at {time.strftime('%X')}")
 
asyncio.run(main())